package cn.hesion.leetcode;
/**
 * ClassName: MinPairSum <br/>
 * Description: <br/>
 * date: 2022/5/11 21:34<br/>
 *
 * @author Hesion<br />
 * @version
 * @since JDK 1.8
 */

import java.util.Arrays;

/**
 * @author: hesion
 * @create: 2022-05-11 21:34
 **/
public class MinPairSum {

    public int minPairSum(int[] nums) {
        Arrays.sort(nums);
        int maxSum = 0;
        for (int i = 0; i < nums.length; i++) {
            int i1 = nums[i] + nums[nums.length - 1-i];
            if (i1 > maxSum) {
                maxSum = i1;
            }
        }
        return maxSum;

    }

    public static void main(String[] args) {
        MinPairSum minPairSum = new MinPairSum();
        System.out.println(minPairSum.minPairSum(new int[]{
                3, 5, 2, 3
        }));
    }
}
